/**
 * @description  : 专卖查询首页
 * @descriptionDetail : 
 * @copyright    : 浙江烟草
 * @author       : mc
 * @create       : 2022-12-05 15:36:26
 */
<template>
  <view class="page">
    <!-- #ifdef H5-ONLY -->
    <theme-navbar
      :is-white="false"
      :title="navTitle"
      :custom-back="goBack"
      style="z-index: 99999"
    >
    </theme-navbar>
    <!-- #endif -->
    <view class="content u-page">
      <!-- 内容区 -->
      <u-image class="head-img" :width="getImgWidth()" src="/static/query/zm_banner.png" mode="widthFix"></u-image>
      <view class="grid-lay">
        <u-grid :col="3" :border="false">
          <u-grid-item :index="index" v-for="(item,index) in list" :key="item.key" @click="gridClick">
            <u-image :src="item.iconPath" :width="120" mode="aspectFit" :height="120"></u-image>
            <view class="grid-text">
              {{ item.text }}
            </view>
          </u-grid-item>
        </u-grid>
      </view>
    </view>
  </view>
</template>

<script> 
export default {
  components: { 
    
  },
  data() {
    return {
      list:[
        {
          key: "JYXXCX",
          iconPath: '../../static/dashboard/jyxx.png',
          url: "/pages/query/cigaretteLogoQuery/cigaretteLogoQuery",
          text: "卷烟信息",
        },
        {
          key: "JGDXCX",
          iconPath: '../../static/dashboard/jgdx.png',
          url: "pages/query/regulationQuery",
          text: "监管对象",
        },
        {
          key: "MDCX",
          iconPath: '../../static/dashboard/mdcx.png',
          url: "/pages/query/barCode/queryBarCode",
          text: "码段查询",
        },
        {
          key: "XKTJ",
          iconPath: '../../static/dashboard/xktj.png',
          url: "/pages/query/stats/statsCom",
          text: "许可统计",
        },
        {
          key: "AJTJ",
          iconPath: '../../static/dashboard/ajtj.png',
          url: "pages/query/stats/caseStats",
          text: "案件统计",
        },
        {
          key: "YJTX",
          iconPath: '../../static/dashboard/yjtx.png',
          url: "/pages/query/earlyWarning/earlywarnList",
          text: "预警提醒",
        },
        {
          key: "TZGG",
          iconPath: '../../static/dashboard/tzgg.png',
          url: "/pages/notice/noticeList",
          text: "通知公告",
        },
        {
          key: "ZJZMCX",
          iconPath: '../../static/dashboard/scjc.png',
          url: "pages/query/coordinateAcquisit",
          text: "坐标采集",
        },
        {
          key: "XYPDCX",
          iconPath: '../../static/dashboard/jgdx.png',
          url: "pages/query/creditLvAssess/creditLvAssess",
          text: "信用评定",
        },
        {
          key: "XYXFFQ",
          iconPath: '../../static/common/icon_zjwts.png',
          url: "pages/check/CreditRepairOrigination/CreditRepairOrigination",
          text: "信用评定",
        },
        {
          key: "LSHBJ",
          iconPath: '../../static/common/bjlsh.png',
          url: "pages/query/editRetailer/retailerList",
          text: "零售户编辑",
        },
      ],
    };
  }, 
  // 页面加载成功后也要设置一次，用于处理本页面刷新后失效问题
  mounted() {
    
  },
  methods: {
    gridClick(index){
      console.log(index)
      if(this.list[index].url){
        this.setRouteParam(this.list[index].text);
        this.$u.route(this.list[index].url);
      }
    },
    getImgWidth(){
      return (this.$u.sys().windowWidth - uni.upx2px(32)) + 'px';
    },
  },
};
</script>

<style lang="scss" scoped>
.head-img{
  width: 100%;
  padding: 16rpx 16rpx;
  margin: 0 auto;
}
.grid-lay{
	padding: 0 32rpx;
}
.grid-text{
	color: $u-main-color;
	margin-top: 24rpx;
	font-size: 30rpx;
}
</style>
